using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace CubicFWNet.Data.Models.Mapping
{
    public class NewsTypeMap : EntityTypeConfiguration<NewsType>
    {
        public NewsTypeMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.TypeName)
                .HasMaxLength(64);

            // Table & Column Mappings
            this.ToTable("NewsType");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.TypeName).HasColumnName("TypeName");
            this.Property(t => t.Class).HasColumnName("Class");
            this.Property(t => t.Sort).HasColumnName("Sort");
            this.Property(t => t.Status).HasColumnName("Status");
        }
    }
}
